{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Using TensorFlow backend.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "preprocessed: dataset/data_vgg/cats//cat.1.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.10.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.100.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.101.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.102.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.103.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.104.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.105.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.106.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.107.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.108.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.109.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.11.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.110.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.111.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.112.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.113.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.114.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.115.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.116.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.117.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.118.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.119.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.12.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.120.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.121.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.122.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.123.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.124.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.125.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.126.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.127.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.128.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.129.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.13.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.130.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.131.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.132.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.133.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.134.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.135.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.136.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.137.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.138.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.139.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.14.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.140.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.141.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.142.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.143.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.144.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.145.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.146.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.147.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.148.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.149.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.15.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.150.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.151.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.152.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.153.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.154.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.155.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.156.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.157.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.158.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.159.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.16.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.160.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.161.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.162.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.163.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.164.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.165.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.166.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.167.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.168.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.169.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.17.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.170.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.171.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.172.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.173.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.174.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.175.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.176.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.177.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.178.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.179.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.18.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.180.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.181.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.182.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.183.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.184.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.185.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.186.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.187.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.188.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.189.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.19.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.190.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.191.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.192.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.193.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.194.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.195.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.196.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.197.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.198.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.199.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.2.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.20.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.200.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.201.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.202.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.203.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.204.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.205.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.206.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.207.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.208.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.209.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.21.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.210.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.211.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.212.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.213.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.214.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.215.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.216.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.217.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.218.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.219.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.22.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.220.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.221.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.222.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.223.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.224.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.225.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.226.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.227.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.228.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.229.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.23.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.230.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.231.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.232.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.233.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.234.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.235.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.236.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.237.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.238.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.239.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.24.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.240.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.241.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.242.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.243.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.244.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.245.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.246.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.247.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.248.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.249.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.25.jpg\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "preprocessed: dataset/data_vgg/cats//cat.250.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.251.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.252.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.253.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.254.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.255.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.256.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.257.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.258.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.259.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.26.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.260.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.261.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.262.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.263.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.264.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.265.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.266.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.267.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.268.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.269.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.27.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.270.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.271.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.272.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.273.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.274.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.275.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.276.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.277.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.278.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.279.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.28.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.280.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.281.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.282.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.283.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.284.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.285.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.286.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.287.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.288.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.289.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.29.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.290.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.291.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.292.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.293.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.294.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.295.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.296.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.297.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.298.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.299.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.3.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.30.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.300.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.31.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.32.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.33.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.34.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.35.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.36.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.37.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.38.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.39.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.4.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.40.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.41.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.42.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.43.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.44.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.45.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.46.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.47.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.48.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.49.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.5.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.50.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.51.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.52.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.53.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.54.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.55.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.56.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.57.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.58.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.59.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.6.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.60.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.61.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.62.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.63.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.64.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.65.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.66.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.67.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.68.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.69.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.7.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.70.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.71.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.72.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.73.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.74.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.75.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.76.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.77.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.78.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.79.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.8.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.80.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.81.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.82.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.83.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.84.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.85.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.86.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.87.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.88.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.89.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.9.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.90.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.91.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.92.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.93.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.94.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.95.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.96.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.97.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.98.jpg\n",
      "preprocessed: dataset/data_vgg/cats//cat.99.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.1.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.10.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.100.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.101.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.102.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.103.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.104.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.105.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.106.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.107.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.108.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.109.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.11.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.110.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.111.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.112.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.113.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.114.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.115.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.116.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.117.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.118.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.119.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.12.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.120.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.121.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.122.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.123.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.124.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.125.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.126.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.127.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.128.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.129.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.13.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.130.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.131.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.132.jpg\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "preprocessed: dataset/data_vgg/dogs//dog.133.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.134.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.135.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.136.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.137.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.138.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.139.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.14.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.140.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.141.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.142.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.143.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.144.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.145.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.146.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.147.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.148.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.149.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.15.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.150.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.151.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.152.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.153.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.154.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.155.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.156.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.157.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.158.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.159.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.16.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.160.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.161.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.162.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.163.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.164.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.165.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.166.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.167.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.168.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.169.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.17.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.170.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.171.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.172.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.173.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.174.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.175.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.176.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.177.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.178.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.179.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.18.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.180.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.181.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.182.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.183.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.184.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.185.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.186.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.187.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.188.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.189.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.19.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.190.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.191.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.192.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.193.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.194.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.195.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.196.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.197.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.198.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.199.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.2.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.20.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.200.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.201.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.202.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.203.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.204.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.205.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.206.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.207.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.208.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.209.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.21.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.210.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.211.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.212.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.213.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.214.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.215.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.216.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.217.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.218.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.219.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.22.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.220.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.221.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.222.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.223.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.224.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.225.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.226.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.227.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.228.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.229.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.23.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.230.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.231.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.232.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.233.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.234.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.235.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.236.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.237.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.238.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.239.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.24.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.240.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.241.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.242.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.243.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.244.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.245.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.246.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.247.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.248.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.249.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.25.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.250.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.251.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.252.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.253.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.254.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.255.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.256.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.257.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.258.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.259.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.26.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.260.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.261.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.262.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.263.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.264.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.265.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.266.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.267.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.268.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.269.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.27.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.270.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.271.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.272.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.273.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.274.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.275.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.276.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.277.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.278.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.279.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.28.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.280.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.281.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.282.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.283.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.284.jpg\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "preprocessed: dataset/data_vgg/dogs//dog.285.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.286.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.287.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.288.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.289.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.29.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.290.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.291.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.292.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.293.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.294.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.295.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.296.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.297.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.298.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.299.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.3.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.30.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.300.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.31.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.32.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.33.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.34.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.35.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.36.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.37.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.38.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.39.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.4.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.40.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.41.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.42.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.43.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.44.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.45.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.46.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.47.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.48.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.49.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.5.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.50.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.51.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.52.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.53.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.54.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.55.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.56.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.57.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.58.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.59.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.6.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.60.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.61.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.62.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.63.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.64.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.65.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.66.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.67.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.68.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.69.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.7.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.70.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.71.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.72.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.73.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.74.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.75.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.76.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.77.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.78.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.79.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.8.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.80.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.81.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.82.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.83.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.84.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.85.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.86.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.87.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.88.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.89.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.9.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.90.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.91.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.92.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.93.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.94.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.95.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.96.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.97.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.98.jpg\n",
      "preprocessed: dataset/data_vgg/dogs//dog.99.jpg\n",
      "(300, 25088) (300, 25088)\n",
      "(600, 25088) (600, 1)\n"
     ]
    }
   ],
   "source": [
    "#load image and preprocess it with vgg16 structure\n",
    "#--by flare\n",
    "from keras.preprocessing.image import img_to_array,load_img\n",
    "from keras.applications.vgg16 import VGG16\n",
    "from keras.applications.vgg16 import preprocess_input\n",
    "import numpy as np\n",
    "\n",
    "model_vgg = VGG16(weights='imagenet', include_top=False)\n",
    "#define a method to load and preprocess the image\n",
    "def modelProcess(img_path,model):\n",
    "    img = load_img(img_path, target_size=(224, 224))\n",
    "    img = img_to_array(img)\n",
    "    x = np.expand_dims(img,axis=0)\n",
    "    x = preprocess_input(x)\n",
    "    x_vgg = model.predict(x)\n",
    "    x_vgg = x_vgg.reshape(1,25088)\n",
    "    return x_vgg\n",
    "#list file names of the training datasets\n",
    "import os\n",
    "folder = \"dataset/data_vgg/cats\"\n",
    "dirs = os.listdir(folder)\n",
    "#generate path for the images\n",
    "img_path = []\n",
    "for i in dirs:                             \n",
    "    if os.path.splitext(i)[1] == \".jpg\":   \n",
    "        img_path.append(i)\n",
    "img_path = [folder+\"//\"+i for i in img_path]\n",
    "\n",
    "#preprocess multiple images\n",
    "features1 = np.zeros([len(img_path),25088])\n",
    "for i in range(len(img_path)):\n",
    "    feature_i = modelProcess(img_path[i],model_vgg)\n",
    "    print('preprocessed:',img_path[i])\n",
    "    features1[i] = feature_i\n",
    "    \n",
    "folder = \"dataset/data_vgg/dogs\"\n",
    "dirs = os.listdir(folder)\n",
    "img_path = []\n",
    "for i in dirs:                             \n",
    "    if os.path.splitext(i)[1] == \".jpg\":   \n",
    "        img_path.append(i)\n",
    "img_path = [folder+\"//\"+i for i in img_path]\n",
    "features2 = np.zeros([len(img_path),25088])\n",
    "for i in range(len(img_path)):\n",
    "    feature_i = modelProcess(img_path[i],model_vgg)\n",
    "    print('preprocessed:',img_path[i])\n",
    "    features2[i] = feature_i\n",
    "    \n",
    "#label the results\n",
    "print(features1.shape,features2.shape)\n",
    "y1 = np.zeros(300)\n",
    "y2 = np.ones(300)\n",
    "\n",
    "#generate the training data\n",
    "X = np.concatenate((features1,features2),axis=0)\n",
    "y = np.concatenate((y1,y2),axis=0)\n",
    "y = y.reshape(-1,1)\n",
    "print(X.shape,y.shape)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
